<?php
$system_folder = "system";
$application_folder = "application";

define('BASEPATH', dirname (__FILE__)."/../../../../../");
define('APPPATH', BASEPATH.$system_folder."/".$application_folder.'/');
require_once(BASEPATH.$system_folder."/helpers/file_helper.php");

// Pull in the NuSOAP code
require_once(BASEPATH.$system_folder.'/libraries/nusoap/nusoap.php');


// Create the client instance
$client = new soapclient('http://lokal.si_del_2.del.ac.id/system/application/modules/lkm/ws/lkm_log_ws.php?wsdl', true);
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('insertLog', array('nim' => '11107001','dt_log' => '2010-02-10 11:01:01','status' => 'out_campus')  );
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        // Display the result
        echo '<h2>Result</h2><pre>';
        print_r($result);
    echo '</pre>';
    }
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>

